package com.visionblue.business.ship.model.repository.db

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.Ignore
import androidx.room.PrimaryKey
import com.visionblue.business.ship.model.bean.response.ApplicationDetail

/**
 * @author: xlh
 * @date: 2020-06-05 9:55 AM
 * @desc:
 * !!!!!!!!!! 如果该表添加字段  则CollectionViewModel的queryCachedOrderById()方法中的对象赋值过程中也需添加!!!!
 */
@Entity(tableName = "cached_order")
data class CachedOrder(
    @ColumnInfo(name = "sn")
    var sn: String? = null,
    @ColumnInfo(name = "company_name")
    var companyName: String? = null,
    @ColumnInfo(name = "application_id")
    var applicationId: String? = null,
    // 收集开始时间
    @ColumnInfo(name = "start_time")
    var startTime: Long = -1L,
    // 收集结束时间
    @ColumnInfo(name = "end_time")
    var endTime: Long? = null,
    @PrimaryKey(autoGenerate = true)
    var id: Long? = null,
    @Ignore
    var applicationDetail: ApplicationDetail? = null
) {
    fun hasSetStartTime() = startTime != -1L
}